package com.iris.live.services.data.models;

import javax.persistence.*;
import java.sql.Timestamp;

/**
 * Created by HangLiu on 2017/2/17.
 */
@Entity
@Table(name = "exchange_stock_log", schema = "live", catalog = "")
public class ExchangeStockLogModel {
    private Integer id;
    private String orgQid;
    private Integer quoteId;
    private Integer oldStockId;
    private Integer newStockId;
    private String updateAccount;
    private Timestamp updateTime;

    @Id
    @Column(name = "id")
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    @Basic
    @Column(name = "org_qid")
    public String getOrgQid() {
        return orgQid;
    }

    public void setOrgQid(String orgQid) {
        this.orgQid = orgQid;
    }

    @Basic
    @Column(name = "quote_id")
    public Integer getQuoteId() {
        return quoteId;
    }

    public void setQuoteId(Integer quoteId) {
        this.quoteId = quoteId;
    }

    @Basic
    @Column(name = "old_stock_id")
    public Integer getOldStockId() {
        return oldStockId;
    }

    public void setOldStockId(Integer oldStockId) {
        this.oldStockId = oldStockId;
    }

    @Basic
    @Column(name = "new_stock_id")
    public Integer getNewStockId() {
        return newStockId;
    }

    public void setNewStockId(Integer newStockId) {
        this.newStockId = newStockId;
    }

    @Basic
    @Column(name = "update_account")
    public String getUpdateAccount() {
        return updateAccount;
    }

    public void setUpdateAccount(String updateAccount) {
        this.updateAccount = updateAccount;
    }

    @Basic
    @Column(name = "update_time")
    public Timestamp getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Timestamp updateTime) {
        this.updateTime = updateTime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        ExchangeStockLogModel logModel = (ExchangeStockLogModel) o;

        if (id != null ? !id.equals(logModel.id) : logModel.id != null) return false;
        if (orgQid != null ? !orgQid.equals(logModel.orgQid) : logModel.orgQid != null) return false;
        if (quoteId != null ? !quoteId.equals(logModel.quoteId) : logModel.quoteId != null) return false;
        if (oldStockId != null ? !oldStockId.equals(logModel.oldStockId) : logModel.oldStockId != null) return false;
        if (newStockId != null ? !newStockId.equals(logModel.newStockId) : logModel.newStockId != null) return false;
        if (updateAccount != null ? !updateAccount.equals(logModel.updateAccount) : logModel.updateAccount != null)
            return false;
        if (updateTime != null ? !updateTime.equals(logModel.updateTime) : logModel.updateTime != null) return false;

        return true;
    }

    @Override
    public int hashCode() {
        int result = id != null ? id.hashCode() : 0;
        result = 31 * result + (orgQid != null ? orgQid.hashCode() : 0);
        result = 31 * result + (quoteId != null ? quoteId.hashCode() : 0);
        result = 31 * result + (oldStockId != null ? oldStockId.hashCode() : 0);
        result = 31 * result + (newStockId != null ? newStockId.hashCode() : 0);
        result = 31 * result + (updateAccount != null ? updateAccount.hashCode() : 0);
        result = 31 * result + (updateTime != null ? updateTime.hashCode() : 0);
        return result;
    }
}
